package comm.test.bean;

import org.hibernate.service.spi.InjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.xml.ws.RequestWrapper;
import java.lang.reflect.Array;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * @author WangLin
 * @packageName
 * @ClassName People
 * @date 2020/10/27 21:45
 * @description
 */
@Component("people")
public class People {

//    @Autowired(required = false)
//      @Qualifier("rice")

    @Resource(name = "meatRice")

//    @Inject
    Rice rice;

    String desc = null;
    List<Rice> riceList;
    Map<String,Rice> riceMap;
    Map<String,String> map;
    Set<Rice> riceSet;
    Rice[] arrays;

    public void eat(){

        /*System.out.println(riceList.size());
        for(Rice r:riceList){
            System.out.println(r);
        }

        System.out.println(riceMap.size());
        System.out.println(riceMap);


        System.out.println(map.size());
        System.out.println(map);

        System.out.println(riceSet.size());
        for(Rice r:riceSet){
            System.out.println(r);
        }

        System.out.println(arrays.length);
        System.out.println(arrays);*/

        rice.showName();

    }

    public Rice getRice() {
        return rice;
    }

    public void setRice(Rice rice) {
        this.rice = rice;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        System.out.println(desc);
        this.desc = desc;
    }

    public List<Rice> getRiceList() {
        return riceList;
    }

    public void setRiceList(List<Rice> riceList) {
        this.riceList = riceList;
    }

    public Map<String, Rice> getRiceMap() {
        return riceMap;
    }

    public void setRiceMap(Map<String, Rice> riceMap) {
        this.riceMap = riceMap;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public Set<Rice> getRiceSet() {
        return riceSet;
    }

    public void setRiceSet(Set<Rice> riceSet) {
        this.riceSet = riceSet;
    }

    public Rice[] getArrays() {
        return arrays;
    }

    public void setArrays(Rice[] arrays) {
        this.arrays = arrays;
    }

    public People(){

    }

    public People(Rice rice, String desc) {
        System.out.println(desc);
        this.rice = rice;
        this.desc = desc;
    }

}
